<!--html head部分  通过引入文件完成(分别适应于PC和手机)-->
<?php include($plume['ROOT_PATH'] . "modules/Track/View/layout/layoutP.phtml"); ?>
<?php
$users = isset($data['users'])?$data['users']:array();
$where = isset($data['where'])?$data['where']:array();
$page = isset($data['pageInfo'])?$data['pageInfo']:array();
$error = isset($plume['error'])?$plume['error']:false;
?>
<div class="container">
<div class="row"><!-- first row -->
<div class="col-md-12 text-center">
  <h4>客户跟踪记录</h4>
  <hr>
</div>
</div><!-- end first row -->
<form id="searchform" name="search"  method="post" action="/track/task/list">
<div class="row"><!-- row -->
<!-- element -->
<div class="col-md-3">
<div class="form-group">
  <div class="row">
    <div class="col-md-3">
      <label for="date">日期：</label>
    </div>
    <div class="col-md-9">
      <input class="form-control" type="datetime" name="date" id="date" placeholder="输入日期" value="<?php echo isset($where['date']) ? substr($where['date'], 0, 10) : '' ?>">
    </div>
  </div>
</div>
</div>
<!-- end elment -->
<!-- element -->
<div class="col-md-3">
<div class="form-group">
  <div class="row">
    <div class="col-md-3">
      <label class="control-label" for="from">姓名：</label>
    </div>
    <div class="col-md-9">
     <input class="form-control" type="text" name="name" id="name" placeholder="输入姓名" value="<?php echo isset($where['name']) ? $where['name'] : '' ?>">
    </div>
  </div>
</div>
</div>
<!-- end elment -->
<!-- element -->
<div class="col-md-3">
<div class="form-group">
  <div class="row">
    <div class="col-md-3">
      <label class="control-label" for="fromkey">QQ号：</label>
    </div>
    <div class="col-md-9">
      <input class="form-control" type="text" name="qq" id="qq" placeholder="输入QQ号" value="<?php echo isset($where['qq']) ? $where['qq'] : '' ?>">
    </div>
  </div>
</div>
</div>
<!-- end elment -->
<!-- element -->
<div class="col-md-3">
<div class="form-group">
  <div class="row">
    <div class="col-md-3">
      <label class="control-label" for="name">电话：</label>
    </div>
    <div class="col-md-9">
      <input class="form-control" type="text" name="tel" id="tel" placeholder="输入电话" value="<?php echo isset($where['tel']) ? $where['tel'] : '' ?>">
    </div>
  </div>
</div>
</div>
<!-- end elment -->
</div><!-- end row -->
<div class="row"><!-- row -->
<div class="col-md-3"><!-- element -->
<div class="form-group">
  <div class="row">
    <div class="col-md-3">
      <label class="control-label" for="name">公司名称：</label>
    </div>
    <div class="col-md-9">
      <input class="form-control" type="text" name="comname" id="comname" placeholder="输入公司名称" value="<?php echo isset($where['comname']) ? $where['comname'] : '' ?>">
    </div>
  </div>
</div>
</div><!-- end elment -->
<div class="col-md-3"><!-- element -->
<div class="form-group">
  <div class="row">
    <div class="col-md-3">
      <label class="control-label" for="name">备注：</label>
    </div>
    <div class="col-md-9">
      <input class="form-control" type="text" name="note" id="note" placeholder="输入备注" value="<?php echo isset($where['note']) ? $where['note'] : '' ?>">
    </div>
  </div>
</div>
</div><!-- end elment -->
<div class="col-md-3"><!-- element -->
<div class="form-group">
  <div class="row">
    <div class="col-md-3">
      <label class="control-label" for="name">被指派人：</label>
    </div>
    <div class="col-md-9">
      <input class="form-control" type="text" name="taskto" id="taskto" placeholder="输入被指派人" value="<?php echo isset($where['taskto']) ? $where['taskto'] : '' ?>">
    </div>
  </div>
</div>
</div><!-- end elment -->
<!-- element -->
<div class="col-md-3">
    <button type="subbmit" id="search" class="btn btn-primary">查询</button>
    <button type="button" id="searchreset" class="btn btn-info">清空查询条件</button>
    <button type="button" id="import" class="btn btn-info" onclick="javascript:location.href='/track/task/edit'">添加客户</button>
</div>
<!-- end element -->
</div><!-- end row -->
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
        <table class="table table-striped table-bordered table-hover table-condensed">
            <tr>
                <th class="text-center info">客户编号</th>
                <th class="text-center info">日期</th>
                <th class="text-center info">来源渠道</th>
                <th class="text-center info">来源跟踪关键字</th>
                <th class="text-center info">姓名</th>
                <th class="text-center info">地区</th>
                <th class="text-center info">QQ号</th>
                <th class="text-center info">电话</th>
                <th class="text-center info">邮箱</th>
                <th class="text-center info">年会类型</th>
                <th class="text-center info">公司名称</th>
                <th class="text-center info">年会规模</th>
                <th class="text-center info">阶段</th>
                <th class="text-center info">备注</th>
                <th class="text-center danger">指派人</th>
                <th class="text-center danger">被指派人</th>
                <th class="text-center">联系日期</th>
                <th class="text-center">联系详情</th>
                <th class="text-center">联系人</th>
                <th class="text-center">操作</th>
                
            </tr>
                <?php
                if (empty($users)) {
                    ?>
                    <tr>
                    <td colspan="4">没有找到客户信息</td>
                    </tr>
                    <?php
                } else {
                    foreach ($users as $value) {
                        ?>
                        <tr class="<?php echo ($value['track_status']==='1')?'success':'' ?>">
                        <td class="text-center">
                            <?php
                            echo $value['id'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo substr($value['date'], 0, 10)
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['from'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['fromkey'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['name'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['area'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['qq'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['tel'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['mail'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['nhtype'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['comname'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['nhscope'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['step'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['note'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['taskfrom'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['taskto'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo substr($value['track_date'], 0, 10)
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['track_detail'];
                            ?>
                        </td>
                        <td class="text-center">
                            <?php
                            echo $value['track_name'];
                            ?>
                        </td>
                        <td class="text-center">
                            <a href="/track/task/edit?id=<?php echo $value['id'];?>">修改 | </a>
                            <a href="/track/task/track?id=<?php echo $value['id'];?>">跟踪记录</a>
                            <!-- <a name="delete" userid="<?php echo $value['id'];?>">删除</a> -->
                        </td>
                        </tr>
                        <?php
                    }
                }
                ?>
        </table>
    </div>
    <?php
    if($page['total'] === 0){
    }else{
    ?>
     <div class="panel-heading text-center">
        <nav>
            <ul class="pagination">
                <li class="<?php echo $page['prev'];?>"><a id="prevClick" prev="<?php echo $page['prevNum'];?>">&laquo;</a></li>
                <li class="active"><a href="javascirpt:void(0)"><?php echo $page['page'];?>/<?php echo $page['totalPage'];?></a></li>
                <li class="<?php echo $page['next'];?>"><a id="nextClick" next="<?php echo $page['nextNum'];?>">&raquo;</a></li>
                <li ><a id="goclick">跳到</a></li>
                <li><input type="text" name="page" id="gonum" class="form-control" style="width:45px;display:inline" value="<?php echo $page['page'];?>"></input></li>
                <li style="float:right"><a>页</a></li>
            </ul>
        </nav>
    </div>
    <?php
    }
    ?>
</div><!--end panel-->
</div><!--end col-->
</div><!--end row-->
</form>
</div><!--end container-->
<!--html body部分 结束-->

<!--html foot部分  通过引入文件完成-->
<?php include($plume['ROOT_PATH'] . "modules/Track/View/layout/footer.phtml"); ?>
<script src="/js/task.js"></script>